import request from '@/utils/request'
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: {
      dictCode
    }
  })
}

export function getComAndOrgTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/getDeptTree',
    method: 'post',
    data
  })
}
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/queryPage',
    method: 'post',
    data
  })
}
export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/updateStatus',
    method: 'post',
    data
  })
}
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/get',
    method: 'post',
    data
  })
}
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/insert',
    method: 'post',
    data
  })
}
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/update',
    method: 'post',
    data
  })
}
export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/deleteById',
    method: 'post',
    data
  })
}
export function queryResult(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/votingStatistics',
    method: 'post',
    data
  })
}
export function queryResult4Detail(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/queryPageVotingDetil',
    method: 'post',
    data
  })
}

export function pget(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/get',
    method: 'post',
    data
  })
}

export function getVotingInfo(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/getVotingInfo',
    method: 'post',
    data
  })
}
export function pgetList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/queryPages',
    method: 'post',
    data
  })
}

/**
 * 获取投票选项详情
 * @param data
 * @returns {*}
 */
export function getOptionDetail(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/get',
    method: 'post',
    data
  })
}

/**
 * 导出票数统计导出
 */
export function exportFile(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/votingInfo/votingStatisticsExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}

/**
 * 票数明细统计导出
 */
export function ticketDetailExportFile(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/votingInfo/votingDetailExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 票数明细统计导出脱敏
 */
export function ticketDetailExportFileMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/votingDetailExportMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 票数明细统计导出不脱敏
 */
export function ticketDetailExportFileNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingInfo/votingDetailExportNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 抽奖活动查询
 * @param {*} query
 */
export function queryChooePage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/bigTurntable/queryPage',
    method: 'post',
    data
  })
}
